<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Outcome of matching</title>
    </h:head>
    <h:body>
        <h:outputText value="Does your Purchase Order matches your Quotation: #{salesOrderBean.matches}" />

        <p></p>
        <h:form id="matchingPurchaseOrder">
            <h:outputText style="font-weight: bold" value="Purchase Order Id: #{salesOrderBean.purchaseOrderId}" />

            <br/><br/>
            <h:dataTable cellpadding="5px" cellspacing="16px" styleClass="allaroundborder" headerClass="allaroundborder" columnClasses="allaroundborder" 
                         rowClasses="allaroundborder" value="#{salesOrderBean.purchaseOrderItemList}" var="purchaseOrder">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Purchase Order Item Id" />
                    </f:facet>
                    <h:outputText value="#{purchaseOrder.id}" />
                </h:column>    

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Product Name" />
                    </f:facet>
                    <h:outputText value="#{purchaseOrder.productName}" />
                </h:column>    

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Number of product" />
                    </f:facet>
                    <h:outputText value="#{purchaseOrder.numOfProduct}" />
                </h:column>    

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Product Price" />
                    </f:facet>
                    <h:outputText value="#{purchaseOrder.productPrice}" />
                </h:column>
                
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Shipping Address" />
                    </f:facet>
                    <h:outputText value="#{purchaseOrder.shippingAddress}" />
                </h:column>
            </h:dataTable>
            
            <!-- Change commandButton Link -->
            <br></br><h:commandButton action="confirmSalesOrder.xhtml" value="Convert to Sales Order" actionListener="#{salesOrderBean.addNewSalesOrder}"/>
            <br></br><h:commandButton action="index.xhtml" value="Return to index" actionListener="#{salesOrderBean.resetAll}"/>
                    </h:form></h:body>  
</ui:composition>
